Custom Crafting Module Creation 1.9
Remark: This tutorial only works for the 1.9 version of the Custom Crafter module. For the 1.8 version, see Custom Crafting Module Creation 1.8. This tutorial will teach you how to make your own modules using the Custom Crafter 2.0 base module(made for 1.9+). On this page, each example will be illustrated using screenshots and the commands that go with it. Tutorial made by SugarCaney. Installing the base module Before you start, make sure you have the 2.0 version of the Custom Crafter base module installed. The One-Click command and the schematic can be found on the Gamemode 4 website: http://www.gm4.co/gamemode4/#viewModule22 Overview Differences with the 1.8 version The way the clock pulses is the 1.9 version is vastly different than the way the clock behaves in the 1.8 version. Also, modules made for the 1.8 Custom Crafter won't work in 1.9. One of these differences is the fact that there are no redstone_blocks placed anymore. ''Another thing that has been added is a module preamble. All modules hooking into the Custom Crafter must have a certain sequence of commands executed before continuing. Reference Image The image below will be used as reference point for this tutorial. The numbers '{1,...,6}' represent the ''preamble. These commands should be executed before any of the recipes. The recipes are marked with the codes {R1,R2}. Please note that the command block number 5''' should be put in ''conditional ''mode. The ArmorStand in the picture (at block no '''1) should have a tag CCC that stands for C''ustom''C''rafter''C''lock. This is the replacement for the 1.8 CCClock. You can add the tag using (with X how close you are to the armorstand): /scoreboard players tag @e[type=armor_stand,r='X'] add CCC Creating the preamble To create the preamble, walk through the following 6 commands and paste them in the command block as seen in the reference image above. Please make sure that command block number '''5' is in conditional ''mode. Build the contraption Build the contraption exactly as seen in the preamble. Note that blocks 1 and 6 are regular command blocks, 5 is a conditional chain command block and the rest are normal chain blocks. All command blocks are pointing to the left. Custom Crafter Clock First you need to make sure that the first command block has an ArmorStand at it's place to serve as a hook for the base module's clock. The ArmorStand should have the "CCC"-tag. You can add this with the first command in this tutorial. Command #'1''' /blockdata ~ ~ ~ {auto:0b} Instead of using a redstone_block as a activation source, the new Custom Crafter module makes use of the tag auto. When auto equals 1b it will be turned on without the need of a redstone source. This feature can be disabled with auto:0b. The base module will set auto to 1b for all ArmorStands with the tag CCC. When this block gets executed it resets the auto tag so it can be re-activated again. This will also cause the next chain command blocks to fire. Command #'2' /execute @etype=armor_stand,name=GM4_CustomCrafter ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:Custom Crafter} This command block will check if the dropper underneath all Custom Crafter ArmorStands has a CustomName of "Custom Crafter". When this command succeeds, its score in the GM4_crafting objective will be set to 1. Otherwise the value of GM4_crafting will be 0. Command #'3' /scoreboard players set @escore_GM4_crafting=0 GM4_crafting 2 This sets the GM4_crafting score to 2 if GM4_crafting ''equals 0 (in other words: when there is no valid dropper underneath it). In that case, make it so we can detect later if the situation is invalid. If it is, there are no recipes to check. Command #'4''' /testfor @escore_GM4_crafting=1,tag=!GM4_isEmpty Test if the GM4_crafting equals EXACTLY 1. It will also check if the dropper is not empty using the GM4_isEmpty tag as given by the base module. Command #'5' Must be a conditional chain command block. /blockdata ~1 ~ ~ {auto:1} If the 4th command succeeded, then execute the next normal command block. This uses the same principle as command block #1. Command #'6' /blockdata ~ ~ ~ {auto:0} Unpower the 6th command block and activate the chain. This uses the same principle as command block #1. Preparing crafting recipes Before you'll be implementing the crafting recipes, you first have to make some preperations. Although you could in theory skip this step, it is strongly advised to follow this step to prevent mistakes (typos are the worst). For this tutorial. We will be making a recipe to gain 4 string back from any coloured wool block. Pre-make the crafting recipes To make it easier to get the data tags of the Custom Crafter right, we make a mock up of the recipe in regular droppers first. For our wool-recipe we'll make the following recipes (in 2 separate droppers): Fetching data tags To fetch the blockdata of the dropper, use the following command on the droppers: /blockdata ~ ~-1 ~ {} When you execute that command in a command block (normal one with buttons or a repeating one set to always active) (make sure you don't forget the empty curly brackets), the blockdata of the block will show up in the commandblock output. Implementing recipes All crafting recipes in the Custom Crafter will get checked the same way. First you have to check for each Custom Crafter if there is a dropper with the required recipe. Once that check succeeds, the crafter's score in the GM4_crafting-objective will become 1. Then you want to execute all actions (like replacing the droppers inventory with the recipe's result) on all ArmorStands with the name GM4_CustomCrafter that have a crafting score of at least 1. It is extremely important that the commands get executed in the right order. You only want stuff to happen when your crafting recipe is used. Checking for the recipe (R1) From our blockdata acquired in step 3, we can easily check if the dropper contains the right materials. For the check, we will use the following (template) command: /execute @etype=armor_stand,name=GM4_CustomCrafter ~ ~ ~ testforblock ~ ~ ~ minecraft:dropper -1 {'} This command will execute the testforblock command as all ArmorStands that are Custom Crafters(name=GM4_CustomCrafter). The testforblock command will check if the dropper at its place (-1 = ignoring the damage value) has all the data as specified in the squiggly brackets. For the data tag we have to specify what items have to be stored in the crafter to mark the craft as successful. For that, we use the Items-tag of the recipe-dropper that we got from the previous step: Items:0:{Slot:0b,id:"minecraft:wool",Count:1b,Damage:0s} Here, there is one minor change you have to make to the data of the dropper. The command block will return the Items list with indices, Items:['0:{Slot.... which are not allowed in commands that check or set a block's data. Simply remove them. Items:{Slot:0b,id:"minecraft:wool",Count:1b,Damage:0s} There is still one problem though. We want to be able to convert ''any ''colour of wool instead of only white wool. The information we got from the dropper will also fetch the damage values required. This means that using this tag, all wool blocks must have a damage value of 0; white wool (''Damage:0s). Luckily, Minecraft will only check for the data tags you specify: so we can easily get rid of the Damage-tag. If we fill this in the template command, we will get the following: /execute @etype=armor_stand,name=GM4_CustomCrafter ~ ~ ~ testforblock ~ ~ ~ minecraft:dropper -1 {Items:{Slot:0b,id:"minecraft:wool",Count:1b}} Also note that the wool is placed in the top-left slot of the dropper to allow players to easily automate the process. Creating the result ('''R2) The result has to be executed after you have performed the check. For the result, we use the following template command: /execute @etype=armor_stand,name=GM4_CustomCrafter,score_GM4_crafting_min=1 ~ ~ ~ blockdata ~ ~ ~ {'} This command will execute as all ArmorStands called GM4_CustomCrafter that have succeeded the previous command. The''GM4_crafting'' objective is an objective that will keep track of successfully executed commands using the SuccessCount stat. When a command get executed successfully (like when you put in the right crafting recipe), the score will become 1, otherwise it will be 0. Once everything matches the crafter, the blockdata of the dropper will be set to a certain value. This value happens to be the items of the result. If we take the Items-tag from the other dropper we made in the previous step and fill it into the {} in the command, you should get the following command: /execute @etype=armor_stand,name=GM4_CustomCrafter,score_GM4_crafting_min=1 ~ ~ ~ blockdata ~ ~ ~ {Items:{Slot:4b,id:"minecraft:string",Count:4b,Damage:0s}} Now the setup should be complete. Give it a try yourself! Custom custom crafters Yes, it says two times custom in the name! Because you can make your own variants on the Custom Crafter. Some modules such as Mastercraftman's Workbench and Equivalent Exchange use Custom Custom Crafters. ''These are custom crafters that will develop special recipes, exclusive to that type of crafter. All you need to do is simply rename the dropper and replace the item on top of the head of the armor stand. Every custom custom crafter requires a recipe. So, put these commands after the last recipe check and before the next. When this recipe is entered, it will upgrade the crafter. Changing the dropper's name This step must be completed for custom and exclusive recipes. Think of a name for your crafter (Let's choose''Iron Crafter) and put that name into this command. /execute @etype=armor_stand,name=GM4_CustomCrafter,score_GM4_crafting_min=1 ~ ~ ~ blockdata ~ ~ ~ {CustomName:"Iron Crafter"} This will edit the GUI display name of the dropper. It is only visible if you exit out of the dropper. When checking for recipes, you should keep in mind that you should also check for "Iron Crafter" as CustomName. It is advised to first create a custom dropper, and then make the recipe commands. Changing the display block This step is optional, but will help you distinguish your crafters from others. /execute @etype=armor_stand,name=GM4_CustomCrafter,score_GM4_crafting_min=1 ~ ~ ~ entitydata @etype=armor_stand,c=1 {ArmorItems:[{},{},{}, {id:"YOUR BLOCK OR ITEM HERE",Count:0b,Damage:0s,}]} This will change the item the armor stand is wearing. Make it personal! Adding crafter-specific recipes To have exclusive custom crafting recipes to your crafter, you will need to add an NBT tag to the recipe detection. /execute @etype=armor_stand,name=GM4_CustomCrafter ~ ~ ~ testforblock ~ ~ ~ minecraft:dropper -1 {CustomName:"'",'} Then you have a custom custom crafter. It will perform all normal custom crafter recipes and any custom ones you have added. This means you only need to have 1 in your base to act as a custom crafter. Beyond the basics Of course, there is more you can do than just put in the crafting result. All actions rely on the same mechanic though: /execute @etype=armor_stand,name=GM4_CustomCrafter,score_GM4_crafting_min=1 ~ ~ ~ . If you want to make more things happen: make sure you execute it after the recipe check but before your next recipe check. This section will contain examples of commands that serve as example for the given effect. Feel free to experiment with the values in the commands! Playing sounds /execute @etype=armor_stand,name=GM4_CustomCrafter,score_GM4_crafting_min=1 ~ ~ ~ playsound tile.piston.in master @ar=4 ~ ~ ~ 1 1.3 1 This command simply plays the tile.piston.in sound to all players within a 4 block range of the Custom Crafter. Changing top block of the crafter /execute @etype=armor_stand,name=GM4_CustomCrafter,score_GM4_crafting_min=1 ~ ~ ~ entitydata @etype=armor_stand,c=1 {ArmorItems:[{},{},{},{id:"''", Count:0b,Damage:0s,}]} Use the entitydata-command to edit the ArmorItems-tag of the ArmorStand that represents the Custom Crafter.The last of 4 slots represents the item that the ArmorStand wears as head gear. Changing the name of the crafter /execute @etype=armor_stand,name=GM4_CustomCrafter,score_GM4_crafting_min=1 ~ ~ ~ blockdata ~ ~ ~ {CustomName:"Amazing Crafter"} Use blockdata to set the inventory name of the dropper to anything you like. If you want to make the Custom Crafter even more custom, you could check in your recipe for the {CustomName:"Your Name"} tag. Shapeless recipes Remove the Slot tags of the detection command to make a recipe shapeless. /execute @etype=armor_stand,name=GM4_CustomCrafter ~ ~ ~ testforblock ~ ~ ~ minecraft:dropper -1 {Items:{id:"minecraft:diamond",Count:1b}} Category:Tutorials Category:Custom Crafting